package com.jt.controller;

import com.jt.annotation.RequiredLog;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/resource")
public class ResourceController {

    @RequiredLog("查询资源")
    @PreAuthorize("hasAuthority('sys:res:create')")
    @GetMapping
    public String doselect(){
        return "select ok";
    }

    @RequiredLog("新增资源")
    @PostMapping
    @PreAuthorize("hasAuthority('sys:res:create')")
    public String dopost(){
        return "created ok";
    }
    @RequiredLog("修改资源")
    @PutMapping
    @PreAuthorize("hasAuthority('sys:res:put')")
    public String doput(){
        return "updated ok";
    }

    @RequiredLog("删除资源")
    @DeleteMapping
    public String dodelete(){
        return "deleted ok";
    }

}
